<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Hex (Commons Codec 1.8 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="Hex (Commons Codec 1.8 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Hex.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/codec/binary/BinaryCodec.html" title="class in org.apache.commons.codec.binary"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html" title="class in org.apache.commons.codec.binary"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/codec/binary/Hex.html" target="_top">Frames</a></li>
<li><a href="Hex.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.codec.binary</div>
<h2 title="Class Hex" class="title">Class Hex</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.codec.binary.Hex</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../../org/apache/commons/codec/BinaryDecoder.html" title="interface in org.apache.commons.codec">BinaryDecoder</a>, <a href="../../../../../org/apache/commons/codec/BinaryEncoder.html" title="interface in org.apache.commons.codec">BinaryEncoder</a>, <a href="../../../../../org/apache/commons/codec/Decoder.html" title="interface in org.apache.commons.codec">Decoder</a>, <a href="../../../../../org/apache/commons/codec/Encoder.html" title="interface in org.apache.commons.codec">Encoder</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">Hex</span>
extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="../../../../../org/apache/commons/codec/BinaryEncoder.html" title="interface in org.apache.commons.codec">BinaryEncoder</a>, <a href="../../../../../org/apache/commons/codec/BinaryDecoder.html" title="interface in org.apache.commons.codec">BinaryDecoder</a></pre>
<div class="block">Converts hexadecimal Strings. The charset used for certain operation can be set, the default is set in
 <a href="../../../../../org/apache/commons/codec/binary/Hex.html#DEFAULT_CHARSET_NAME"><code>DEFAULT_CHARSET_NAME</code></a>

 This class is thread-safe.</div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>1.1</dd>
<dt><span class="strong">Version:</span></dt>
  <dd>$Id: Hex.java 1429868 2013-01-07 16:08:05Z ggregory $</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#DEFAULT_CHARSET">DEFAULT_CHARSET</a></strong></code>
<div class="block">Default charset name is <a href="../../../../../org/apache/commons/codec/Charsets.html#UTF_8"><code>Charsets.UTF_8</code></a></div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#DEFAULT_CHARSET_NAME">DEFAULT_CHARSET_NAME</a></strong></code>
<div class="block">Default charset name is <a href="../../../../../org/apache/commons/codec/CharEncoding.html#UTF_8"><code>CharEncoding.UTF_8</code></a></div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#Hex()">Hex</a></strong>()</code>
<div class="block">Creates a new codec with the default charset name <a href="../../../../../org/apache/commons/codec/binary/Hex.html#DEFAULT_CHARSET"><code>DEFAULT_CHARSET</code></a></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#Hex(java.nio.charset.Charset)">Hex</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a>&nbsp;charset)</code>
<div class="block">Creates a new codec with the given Charset.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#Hex(java.lang.String)">Hex</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charsetName)</code>
<div class="block">Creates a new codec with the given charset name.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#decode(byte[])">decode</a></strong>(byte[]&nbsp;array)</code>
<div class="block">Converts an array of character bytes representing hexadecimal values into an array of bytes of those same values.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#decode(java.lang.Object)">decode</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object)</code>
<div class="block">Converts a String or an array of character bytes representing hexadecimal values into an array of bytes of those
 same values.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#decodeHex(char[])">decodeHex</a></strong>(char[]&nbsp;data)</code>
<div class="block">Converts an array of characters representing hexadecimal values into an array of bytes of those same values.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#encode(byte[])">encode</a></strong>(byte[]&nbsp;array)</code>
<div class="block">Converts an array of bytes into an array of bytes for the characters representing the hexadecimal values of each
 byte in order.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#encode(java.lang.Object)">encode</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object)</code>
<div class="block">Converts a String or an array of bytes into an array of characters representing the hexadecimal values of each
 byte in order.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static char[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#encodeHex(byte[])">encodeHex</a></strong>(byte[]&nbsp;data)</code>
<div class="block">Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static char[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#encodeHex(byte[], boolean)">encodeHex</a></strong>(byte[]&nbsp;data,
         boolean&nbsp;toLowerCase)</code>
<div class="block">Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static char[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#encodeHex(byte[], char[])">encodeHex</a></strong>(byte[]&nbsp;data,
         char[]&nbsp;toDigits)</code>
<div class="block">Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#encodeHexString(byte[])">encodeHexString</a></strong>(byte[]&nbsp;data)</code>
<div class="block">Converts an array of bytes into a String representing the hexadecimal values of each byte in order.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#getCharset()">getCharset</a></strong>()</code>
<div class="block">Gets the charset.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#getCharsetName()">getCharsetName</a></strong>()</code>
<div class="block">Gets the charset name.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#toDigit(char, int)">toDigit</a></strong>(char&nbsp;ch,
       int&nbsp;index)</code>
<div class="block">Converts a hexadecimal character to an integer.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/binary/Hex.html#toString()">toString</a></strong>()</code>
<div class="block">Returns a string representation of the object, which includes the charset name.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a name="DEFAULT_CHARSET">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DEFAULT_CHARSET</h4>
<pre>public static final&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> DEFAULT_CHARSET</pre>
<div class="block">Default charset name is <a href="../../../../../org/apache/commons/codec/Charsets.html#UTF_8"><code>Charsets.UTF_8</code></a></div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>1.7</dd></dl>
</li>
</ul>
<a name="DEFAULT_CHARSET_NAME">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DEFAULT_CHARSET_NAME</h4>
<pre>public static final&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> DEFAULT_CHARSET_NAME</pre>
<div class="block">Default charset name is <a href="../../../../../org/apache/commons/codec/CharEncoding.html#UTF_8"><code>CharEncoding.UTF_8</code></a></div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>1.4</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.commons.codec.binary.Hex.DEFAULT_CHARSET_NAME">Constant Field Values</a></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="Hex()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Hex</h4>
<pre>public&nbsp;Hex()</pre>
<div class="block">Creates a new codec with the default charset name <a href="../../../../../org/apache/commons/codec/binary/Hex.html#DEFAULT_CHARSET"><code>DEFAULT_CHARSET</code></a></div>
</li>
</ul>
<a name="Hex(java.nio.charset.Charset)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Hex</h4>
<pre>public&nbsp;Hex(<a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a>&nbsp;charset)</pre>
<div class="block">Creates a new codec with the given Charset.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>charset</code> - the charset.</dd><dt><span class="strong">Since:</span></dt>
  <dd>1.7</dd></dl>
</li>
</ul>
<a name="Hex(java.lang.String)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Hex</h4>
<pre>public&nbsp;Hex(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charsetName)</pre>
<div class="block">Creates a new codec with the given charset name.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>charsetName</code> - the charset name.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/UnsupportedCharsetException.html?is-external=true" title="class or interface in java.nio.charset">UnsupportedCharsetException</a></code> - If the named charset is unavailable</dd><dt><span class="strong">Since:</span></dt>
  <dd>1.4, 1.7 throws UnsupportedCharsetException if the named charset is unavailable</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="decodeHex(char[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decodeHex</h4>
<pre>public static&nbsp;byte[]&nbsp;decodeHex(char[]&nbsp;data)
                        throws <a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></pre>
<div class="block">Converts an array of characters representing hexadecimal values into an array of bytes of those same values. The
 returned array will be half the length of the passed array, as it takes two characters to represent any given
 byte. An exception is thrown if the passed char array has an odd number of elements.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>data</code> - An array of characters containing hexadecimal digits</dd>
<dt><span class="strong">Returns:</span></dt><dd>A byte array containing binary data decoded from the supplied char array.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></code> - Thrown if an odd number or illegal of characters is supplied</dd></dl>
</li>
</ul>
<a name="encodeHex(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeHex</h4>
<pre>public static&nbsp;char[]&nbsp;encodeHex(byte[]&nbsp;data)</pre>
<div class="block">Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
 The returned array will be double the length of the passed array, as it takes two characters to represent any
 given byte.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>data</code> - a byte[] to convert to Hex characters</dd>
<dt><span class="strong">Returns:</span></dt><dd>A char[] containing hexadecimal characters</dd></dl>
</li>
</ul>
<a name="encodeHex(byte[], boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeHex</h4>
<pre>public static&nbsp;char[]&nbsp;encodeHex(byte[]&nbsp;data,
               boolean&nbsp;toLowerCase)</pre>
<div class="block">Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
 The returned array will be double the length of the passed array, as it takes two characters to represent any
 given byte.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>data</code> - a byte[] to convert to Hex characters</dd><dd><code>toLowerCase</code> - <code>true</code> converts to lowercase, <code>false</code> to uppercase</dd>
<dt><span class="strong">Returns:</span></dt><dd>A char[] containing hexadecimal characters</dd><dt><span class="strong">Since:</span></dt>
  <dd>1.4</dd></dl>
</li>
</ul>
<a name="encodeHex(byte[], char[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeHex</h4>
<pre>protected static&nbsp;char[]&nbsp;encodeHex(byte[]&nbsp;data,
               char[]&nbsp;toDigits)</pre>
<div class="block">Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
 The returned array will be double the length of the passed array, as it takes two characters to represent any
 given byte.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>data</code> - a byte[] to convert to Hex characters</dd><dd><code>toDigits</code> - the output alphabet</dd>
<dt><span class="strong">Returns:</span></dt><dd>A char[] containing hexadecimal characters</dd><dt><span class="strong">Since:</span></dt>
  <dd>1.4</dd></dl>
</li>
</ul>
<a name="encodeHexString(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeHexString</h4>
<pre>public static&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encodeHexString(byte[]&nbsp;data)</pre>
<div class="block">Converts an array of bytes into a String representing the hexadecimal values of each byte in order. The returned
 String will be double the length of the passed array, as it takes two characters to represent any given byte.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>data</code> - a byte[] to convert to Hex characters</dd>
<dt><span class="strong">Returns:</span></dt><dd>A String containing hexadecimal characters</dd><dt><span class="strong">Since:</span></dt>
  <dd>1.4</dd></dl>
</li>
</ul>
<a name="toDigit(char, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toDigit</h4>
<pre>protected static&nbsp;int&nbsp;toDigit(char&nbsp;ch,
          int&nbsp;index)
                      throws <a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></pre>
<div class="block">Converts a hexadecimal character to an integer.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>ch</code> - A character to convert to an integer digit</dd><dd><code>index</code> - The index of the character in the source</dd>
<dt><span class="strong">Returns:</span></dt><dd>An integer</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></code> - Thrown if ch is an illegal hex character</dd></dl>
</li>
</ul>
<a name="decode(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decode</h4>
<pre>public&nbsp;byte[]&nbsp;decode(byte[]&nbsp;array)
              throws <a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></pre>
<div class="block">Converts an array of character bytes representing hexadecimal values into an array of bytes of those same values.
 The returned array will be half the length of the passed array, as it takes two characters to represent any given
 byte. An exception is thrown if the passed char array has an odd number of elements.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/BinaryDecoder.html#decode(byte[])">decode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/BinaryDecoder.html" title="interface in org.apache.commons.codec">BinaryDecoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>array</code> - An array of character bytes containing hexadecimal digits</dd>
<dt><span class="strong">Returns:</span></dt><dd>A byte array containing binary data decoded from the supplied byte array (representing characters).</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></code> - Thrown if an odd number of characters is supplied to this function</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/commons/codec/binary/Hex.html#decodeHex(char[])"><code>decodeHex(char[])</code></a></dd></dl>
</li>
</ul>
<a name="decode(java.lang.Object)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decode</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;decode(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object)
              throws <a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></pre>
<div class="block">Converts a String or an array of character bytes representing hexadecimal values into an array of bytes of those
 same values. The returned array will be half the length of the passed String or array, as it takes two characters
 to represent any given byte. An exception is thrown if the passed char array has an odd number of elements.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/Decoder.html#decode(java.lang.Object)">decode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/Decoder.html" title="interface in org.apache.commons.codec">Decoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>object</code> - A String or, an array of character bytes containing hexadecimal digits</dd>
<dt><span class="strong">Returns:</span></dt><dd>A byte array containing binary data decoded from the supplied byte array (representing characters).</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></code> - Thrown if an odd number of characters is supplied to this function or the object is not a String or
             char[]</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/commons/codec/binary/Hex.html#decodeHex(char[])"><code>decodeHex(char[])</code></a></dd></dl>
</li>
</ul>
<a name="encode(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encode</h4>
<pre>public&nbsp;byte[]&nbsp;encode(byte[]&nbsp;array)</pre>
<div class="block">Converts an array of bytes into an array of bytes for the characters representing the hexadecimal values of each
 byte in order. The returned array will be double the length of the passed array, as it takes two characters to
 represent any given byte.
 <p>
 The conversion from hexadecimal characters to the returned bytes is performed with the charset named by
 <a href="../../../../../org/apache/commons/codec/binary/Hex.html#getCharset()"><code>getCharset()</code></a>.
 </p></div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/BinaryEncoder.html#encode(byte[])">encode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/BinaryEncoder.html" title="interface in org.apache.commons.codec">BinaryEncoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>array</code> - a byte[] to convert to Hex characters</dd>
<dt><span class="strong">Returns:</span></dt><dd>A byte[] containing the bytes of the hexadecimal characters</dd><dt><span class="strong">Since:</span></dt>
  <dd>1.7 No longer throws IllegalStateException if the charsetName is invalid.</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/commons/codec/binary/Hex.html#encodeHex(byte[])"><code>encodeHex(byte[])</code></a></dd></dl>
</li>
</ul>
<a name="encode(java.lang.Object)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encode</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;encode(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object)
              throws <a href="../../../../../org/apache/commons/codec/EncoderException.html" title="class in org.apache.commons.codec">EncoderException</a></pre>
<div class="block">Converts a String or an array of bytes into an array of characters representing the hexadecimal values of each
 byte in order. The returned array will be double the length of the passed String or array, as it takes two
 characters to represent any given byte.
 <p>
 The conversion from hexadecimal characters to bytes to be encoded to performed with the charset named by
 <a href="../../../../../org/apache/commons/codec/binary/Hex.html#getCharset()"><code>getCharset()</code></a>.
 </p></div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/Encoder.html#encode(java.lang.Object)">encode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/Encoder.html" title="interface in org.apache.commons.codec">Encoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>object</code> - a String, or byte[] to convert to Hex characters</dd>
<dt><span class="strong">Returns:</span></dt><dd>A char[] containing hexadecimal characters</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/EncoderException.html" title="class in org.apache.commons.codec">EncoderException</a></code> - Thrown if the given object is not a String or byte[]</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/commons/codec/binary/Hex.html#encodeHex(byte[])"><code>encodeHex(byte[])</code></a></dd></dl>
</li>
</ul>
<a name="getCharset()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCharset</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a>&nbsp;getCharset()</pre>
<div class="block">Gets the charset.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the charset.</dd><dt><span class="strong">Since:</span></dt>
  <dd>1.7</dd></dl>
</li>
</ul>
<a name="getCharsetName()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCharsetName</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getCharsetName()</pre>
<div class="block">Gets the charset name.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the charset name.</dd><dt><span class="strong">Since:</span></dt>
  <dd>1.4</dd></dl>
</li>
</ul>
<a name="toString()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString()</pre>
<div class="block">Returns a string representation of the object, which includes the charset name.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a></code>&nbsp;in class&nbsp;<code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>a string representation of the object.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Hex.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/codec/binary/BinaryCodec.html" title="class in org.apache.commons.codec.binary"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/codec/binary/StringUtils.html" title="class in org.apache.commons.codec.binary"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/codec/binary/Hex.html" target="_top">Frames</a></li>
<li><a href="Hex.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2002-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</small></p>
</body>
</html>
